<?php

namespace app\model;

use think\Model;

// 订单使用优惠券记录表
class OrderCoupon extends Model
{
    // Define the table name
    protected $name = 'order_coupon';
    public $timestamps = false;
    
    // 订单关联
    public function order()
    {
        return $this->hasOne(Orders::class, 'id', 'order_id');
    }
    
    // 优惠券关联
    public function coupon()
    {
        return $this->hasOne(TravelCoupon::class, 'id', 'coupon_id');
    }
    
    // 用户关联
    public function user()
    {
        return $this->hasOne(User::class, 'id', 'user_id');
    }
}